package com.yao.sample.pattern.observer;

import java.util.Observable;

public class WeatherData extends Observable{
	private float temperature;
	private float humidity;
	
	public void setMeasurement(float temperature,float humidity) {
		this.temperature = temperature;
		this.humidity = humidity;
		measurementChange();
	}
	
	public void measurementChange() {
		setChanged();
		notifyObservers();
	}

	public float getTemperature() {
		return temperature;
	}
	public void setTemperature(float temperature) {
		this.temperature = temperature;
	}
	public float getHumidity() {
		return humidity;
	}
	public void setHumidity(float humidity) {
		this.humidity = humidity;
	}
	
}
